package com.Mt.Mager.Contorller;

import com.Mt.Dto.Dto;
import com.Mt.Service.MtAddressService;
import com.Mt.Utils.DtoUtil;
import com.alibaba.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("address")
public class MtAddressController {

    @Reference
    private MtAddressService mtAddressService;
    // 收获地址后台
    @PostMapping("pageAddress")
    public Dto pageAddress(@RequestBody Map<Object, Object> params) {
        System.out.println("运行");
        String userId = params.get("userId").toString();
        String userName = params.get("userName").toString();
        int index = Integer.parseInt(params.get("index").toString());
        return DtoUtil.returnSuccessData(mtAddressService.pageAddress(userId,userName,index));
    }
}
